home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 003 / lineeditor / Rebinder (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1994-10-18  |  2KB  |  124 lines

  1.  >Rebinder
  2. "This program modifies the LineEditor module on disk to"
  3. "change the key bindings."
  4. '"You need to input the name of the file with the new"
  5. "keybindings in."'
  6. $M$="<LineEditor$Dir>.LineEditor"
  7.  M$:len%=
  8.  v$,N%
  9.  T$(N%)
  10.  C% N%, M% len%
  11.  "OS_File",&FF,M$,M%,0
  12. T%=M%+len%-512
  13.  L%=0 
  14.  N%-1
  15.  T$(L%),C%?L%
  16.  T$(L%)="vanilla" v%=L%
  17.  v%=-1 
  18. "No vanilla in key table":
  19. z(M%+M%!20),"Line Editor"+
  20. 9+v$)<>1 
  21. "Incorrect key file version for module":
  22.  "Key definitions file (RETURN for default): "F$
  23.  F$="" F$="<LineEditor$Dir>.DfltKeys"
  24. WS$=" "+
  25. ::DIM XXX% 512:FOR L%=0 TO 511:XXX%?L%=T%?L%:NEXT
  26.  L%=0 
  27.  511:T%?L%=C%?v%:
  28. L$,"&")
  29.   T$=
  30. L$,I%)
  31.  HACKARAMA
  32. !1  I%=
  33. T$,"-"):
  34.  I% T$=
  35. T$,I%-1)+"~"+
  36. T$,I%+1)
  37.   K%=
  38. T$:K2%=K%
  39. T$,2)
  40. "0123456789ABCDEFabcdef",
  41. T$,1))=0 
  42.  T$=""
  43. T$,1)="~" 
  44.    T$=
  45. T$,2)
  46. T$,1)<>"&" T$="&"+T$
  47.    K2%=
  48. T$,2)
  49. *4   
  50. "0123456789ABCDEFabcdef",
  51. T$,1))=0 
  52.  T$=""
  53. T$,1)) 
  54.  T$<>""
  55.    T$=
  56. T$,2)
  57.  T$ is the action token for key codes K% to K2%
  58.  force to upper-case
  59. 13  t$=T$:T$="":
  60.  L%=1
  61. t$:T$+=
  62. t$,L%,1)
  63.   t%=0
  64.  T$<>T$(t%) 
  65.  t%<N%
  66.    t%+=1
  67.  t%=N% 
  68. "Bad TOKEN '"T$"'":
  69.  K%<0 
  70.  K%>&1FF 
  71.  K2%<0 
  72.  K2%>&1FF 
  73. "Bad key number":
  74. ::PRINTK%"-";K2%" ";t%
  75.  L%=K% 
  76.  K2%:T%?L%=C%?t%:
  77.  "OS_File",&0A,M$,&FFA,,M%,M%+len%
  78.  "OS_Module",11,M%,len%
  79. ::FOR L%=0 TO 511:IF XXX%?L%<>T%?L% PRINTL%" ";XXX%?L%"->";T%?L%:N.ELSEN.
  80. z(A%):
  81.  ?A%:A$+=
  82. ?A%:A%+=1:
  83.  >KEYLIB
  84.  2.65
  85.  ignore,3
  86.  beepignore,65
  87.  left,0
  88.  right,4
  89.  delword,106
  90.  cright,9
  91.  cleft,16
  92.  sright,22
  93.  sleft,32
  94.  toggleinsert,47
  95.  delline,53
  96.  removeline,50
  97.  complete,56
  98.  completenext,59
  99.  completeprev,61
  100.  setmark,64
  101.  copy,67
  102.  swapmark,75
  103.  cut,88
  104.  deletenext,124
  105.  delete,125
  106.  wipehistory,139
  107.  deltoend,144
  108.  paste,145
  109.  swapchars,153
  110.  quote,168
  111.  vanilla,174
  112.  cup,189
  113.  cdown,198
  114.  up,199
  115.  down,214
  116.  sup,224
  117.  sdown,225
  118.  escape,226
  119.  fnkey,246
  120.  wipeallhistory,142
  121.  enter,236
  122.  return,240
  123.  uncopy,232
  124.